package com.yishuai.ollamatest1.dto;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.validation.constraints.NotBlank;

/**
 * 支持从前端接收多种字段名，例如: "message", "prompt", "text", "content"
 * 并在没有有效文本时触发校验错误。
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class ChatRequest {

    @NotBlank(message = "message 不能为空")
    @JsonAlias({"prompt", "text", "content"})
    private String message;

    public ChatRequest() {}

    public ChatRequest(String message) { this.message = message; }

    public String getMessage() { return message; }

    public void setMessage(String message) { this.message = message; }
}
